package VN.EDU.IMIC.DEVELOPER.VUVANLUANLEVEL2.EXR0102;

public class models {
	public double calculatorarea(rectaninformation objrectan){
		double result = 0;
		double p = (objrectan.getSide1() + objrectan.getSide2() + objrectan.getSide3())/2;
	result = Math.sqrt(p*(p - objrectan.getSide1())*(p - objrectan.getSide2())*(p - objrectan.getSide3()));

	return result;}
	public double calculatorperimeter(rectaninformation objrectan){
		double result = 0;
		result = objrectan.getSide1() + objrectan.getSide2() + objrectan.getSide3();
		return result;
	}
	public String calculatortostring(rectaninformation objrectan){
		String result ="Tam giac co : canh thu nhat bang " + objrectan.getSide1() + "  canh thu hai bang  " + objrectan.getSide2() + "  canh thu ba bang  " + objrectan.getSide3();
		return result;
	}
	public double calculatorarealucgiac(rectaninformation objrectan){
		double result = (2 + 4/Math.sqrt(2))*objrectan.getSidelucgiac()*objrectan.getSidelucgiac();
		return result;
			}
public double calculatorperimeterlucgiac(rectaninformation objrectan){
	double result = 8*objrectan.getSidelucgiac();
	return result;
}
	
}
